package iterator;

import java.util.List;

public class FirefoxMenuIterator implements Iterator {
    List<MenuItem> items;
    int cur;

    public FirefoxMenuIterator(List<MenuItem> items) {
        this.items = items;
    }

    @Override
    public boolean hasNext() {
        return !items.isEmpty() && cur < items.size();
    }

    @Override
    public MenuItem next() {
        return items.get(cur++);
    }
}
